package y23.Jun;
//求1+2+3+……+10的和
public class Test11 {
    public static void main(String[] args) {
        int num = 10;
        int sum = numSum(num);
        System.out.println(sum);
    }
    public static int numSum(int num){
        if(num == 1){
            return 1;
        }
        return num + numSum(num - 1);
    }

}
